package com.icarus.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

import com.icarus.quartz.service.impl.SpringJobFactory;

@Configuration
public class Config {

	@Autowired
	private SpringJobFactory springJobFactory;

	@Bean
	public SchedulerFactoryBean schedulerFactoryBean() {
		SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean();
		// schedulerFactoryBean.setJobFactory(springJobFactory);
		schedulerFactoryBean.setConfigLocation(new ClassPathResource(
				"quartz.properties"));
		return schedulerFactoryBean;
	}

	/*
	 * @Bean public Scheduler scheduler() { return
	 * schedulerFactoryBean().getScheduler(); }
	 */
}
